<!--
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: fgz
 * @Date: 2021-10-25 11:53:03
 * @LastEditors: fgz
 * @LastEditTime: 2021-10-25 17:48:05
-->
<template>
  <div class="footer-container">
    <!-- 左侧的全选 -->
    <div class="custom-control custom-checkbox">
      <input type="checkbox" class="custom-control-input" id="cbFull" :checked="isfull" @change="fullChange">
      <label for="cbFull" class="custom-control-label">全选</label>
    </div>

    <!-- 中间的合计 -->
    <div>
      <span>合计：</span>
      <span class="total-price">￥{{amount.toFixed(2)}}</span>
    </div>

    <!-- 结算按钮 -->
    <button type="button" class="btn btn-primary btn-settle">结算 ({{all}})</button>
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {
    // 全选的状态
    isfull: {
      type: Boolean,
      default: true
    },
    amount:{
      type: Number,
      default: 0
    },
    // 已勾选的商品的总数量
    all: {
      type: Number,
      default: 0
    }
  },
  data () {
    return {
    }
  },
  methods: {
    fullChange(e){
      this.$emit('full-change',e.target.checked)
    }
  },
  mounted(){},
}
</script>

<style lang='less' scoped>
.footer-container{
  font-size: 12px;
  height: 50px;
  width: 100%;
  border-top: 1px solid #efefef;
  position: fixed;
  bottom: 0;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-around;
  .custom-checkbox{
    display: flex;
    align-items: center;
    .custom-control-input{
      margin-right: 5px;
    }
  }
}
</style>
